package com.adminx.util;

import java.util.List;

/**
 * 分页封装�?
 * 用于做分页查询的基础类，封装了一些分页的相关属�?
 * 
 * @author liancheng
 *
 */
public class PageResults<T> {

	// 当前页
	private int pageIndex;

	// 每页条数
	private int pageSize;

	// 总条数
	private int total;

	// 总页数
	private int pageCount;

	// 记录
	private List<T> results;

	public int getPageCount() {
		return pageCount;
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

	public List<T> getResults() {
		return results;
	}

	public void setResults(List<T> results) {
		this.results = results;
	}

	public int getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize <= 0 ? 10 : pageSize;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	@Override
	public String toString() {
		return "PageResults [pageIndex=" + pageIndex + ", pageSize=" + pageSize + ", total=" + total + ", pageCount="
				+ pageCount + ", results=" + results + "]";
	}
}
